package com.xm.servlet.background.employee;

import com.xm.entity.AdministratorInformation;
import com.xm.service.background.AdministratorInformationService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 员工Servlet
 * @author 陈盼
 * @date 2023-12-28 下午 03:10
 */
@WebServlet("/background/get/employee")
public class GetEmployeeServlet extends HttpServlet {
    private final AdministratorInformationService service = new AdministratorInformationService();

    @SneakyThrows(Exception.class)
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)  {
        resp.setContentType("text/html;charset=utf-8");
        List<AdministratorInformation> administratorInformationList = service.getAll();
        req.setAttribute("administratorInformationList",administratorInformationList);
    }
}
